-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
set MDC so that one can route minion task logs to separate files cleanly #9400
Conversation
example:
|
Codecov Report
@@ Coverage Diff @@
## master #9400 +/- ##
============================================
+ Coverage 69.67% 69.78% +0.11%
+ Complexity 4787 4708 -79
============================================
Files 1885 1890 +5
Lines 100419 100656 +237
Branches 15283 15327 +44
============================================
+ Hits 69966 70245 +279
+ Misses 25490 25430 -60
- Partials 4963 4981 +18
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
pinot-minion/src/main/java/org/apache/pinot/minion/taskfactory/TaskFactoryRegistry.java
Outdated
Show resolved
Hide resolved
</Route> | ||
</Routes> | ||
<!-- Created appender TTL --> | ||
<IdlePurgePolicy timeToLive="15" timeUnit="minutes"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i understood the rollover if > 19.5MB or rollover if > 50 files.
What's the 15 minutes TTL? will that be enough?
Also is 50 max good enough? We could have a lot more tasks running at once rt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
per the doc: 15min TTL is used to close the dynamically created appender, after it's idle for up to TTL.
as to purge old log files, there are multiple options: by max count as in the example here or time based (which may be more suitable for prod use, e.g. to keep log files as long as the task info is kept in helix, which is 24hr by default)
05c07ea
to
3207b9a
Compare
3207b9a
to
893870f
Compare
Allow one to route
all
logs (including exception stack trace) emit during a minion task execution to a separate file, so that the task logs can be accessed via the download/log restful API added recently. Using MDC, so that we can capture the task logs completely, assuming the task is done by a single thread on minion worker which is the case today.Added an example log4j2.xml for reference.
Alternatively, we might search logs from the default log file with the taskId, but that wouldn't work cleanly: 1) not all task logs are tagged with taskId; 2) the exception stacktrace would be missed; 3) costly to search log msgs from a large log file every time, and potentially from archived log files.